
package eSchool.BL;

import eSchool.DataLayer.DAOFactory;
import eSchool.DataLayer.IFuncionarioDAO;

public class Funcionarios extends BasicListObject<Funcionario> implements IDadosEntidade {
    
    Funcionario func = new Funcionario();
    
    public Funcionarios(){
    }
    
    public Funcionarios(CriteriosPesquisa criterios) throws Exception{
        this.leDados(criterios);
    }
    
    
    public String[][] toStringArray() {
        return null;
    }

    @Override
    public int getColumnCount() {
        return func.getColumnCount();
    }

    @Override
    public String getColumnName(int columnIndex) {
        return func.getColumnName(columnIndex);
    }

    @Override
    public Class<?> getColumnClass(int columnIndex) {
       return func.getColumnClass(columnIndex);
    }
    
    
    public Object getValueAt(int rowIndex, int columnIndex){
           return this.get(rowIndex).getValueAt(0, columnIndex);
    } 

    public void setValueAt(Object aValue, int rowIndex, int columnIndex){
            this.get(rowIndex).setValueAt(aValue, 0, columnIndex);
    }

    @Override
    public void leDados() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    public void leDados(CriteriosPesquisa criterios) throws Exception {
        DAOFactory factory = DAOFactory.getDAOFactory(DAOFactory.ACCESS);
        IFuncionarioDAO funcionarioDAO = factory.getFuncionarioDAO();           
        funcionarioDAO.selectFuncionarioTO(this, criterios);
    }

    @Override
    public void gravaDados() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
